package com.webdrop.utils;

import java.util.HashMap;

import com.webdrop.utils.HistoryParams;

import com.google.gwt.user.client.History;


public class HistoryParams extends HashMap<String, String>
{
	private String paramString;
	
	public static HistoryParams getInstance()
	{
		return new HistoryParams(History.getToken());
	}
	
	public HistoryParams(String params)
	{
		paramString = params;
		
		String[] historyTokens = paramString.split(";");

		for (String token : historyTokens)
		{
			String[] keyValue = token.split("=");
			
			if (keyValue.length == 2)
				this.put(keyValue[0], keyValue[1]);
		}
	}
	
	public String getParamString()
	{
		return paramString;
	}
}

